<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
	    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover" />
	    <title>app下载</title> 
	    <link rel="stylesheet" type="text/css" href="css/common.css"/>
	    <link rel="stylesheet" type="text/css" href="css/downApp.css"/>
	</head>
	<body>
		<section id="downApp">
			<div class="imgDiv">
				<img src="img/downApp/1.png"/>
			</div>
			<div class="imgDivText">
				<img src="img/downApp/2.png"/>			
			</div>
			<div class="erweima">
				<img src="img/downApp/erweima.jpg"/>			
			</div>
		    <div class="mui-row buttonImg">
		        <div class="mui-col-md-6 mui-col-sm-6 mui-col-xs-6">
		           <a id="android"><img src="img/downApp/3.png"/></a>
		        </div>
		        <div class="mui-col-md-6 mui-col-sm-6 mui-col-xs-6">
		            <a id="ios"><img src="img/downApp/4.png" alt="" /></a>
		        </div>
		    </div>
		</section>
		<div class="maskTishi">
			<ul class="tishi">
				<li class="arrow clearfix"><div class="rt">
				<img src="img/downApp/arrow.png" alt="" /></div></li>
				<li><span>1</span> 点 击 右 上 角 按 钮</li>
				<li><span>2</span> 选 择 默 认 浏 览 器 打 开</li>
			</ul>
		</div>
	</body>
	<script src="js/jquery.min.js"></script>
	<script src='js/basic.js'></script>
	<script type="text/javascript">
		var ua = navigator.userAgent.toLowerCase();
		// apk不能直接在微信里面点击下载，在扣扣浏览器可以但是需要看客户需求
		// ios 的直接到 app stroe里面下载
		var urls = {
			'android':'http://47.94.137.154:8080/apk/junying.apk',
			'ios':'https://itunes.apple.com/cn/app/zhong-guo-che-you-hui/id640447959'
	    };
		$("#android").on("click",function(){
			if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){
				//这是iOS平台下浏览器
				alert("请点击“ios下载”按钮");
				return false;
			}
			/*安卓的机型和微信内置浏览器和qq内置浏览器*/
			if(/android/i.test(navigator.userAgent)){
				//这是Android平台下浏览器
				if(/MicroMessenger/i.test(navigator.userAgent)||ua.indexOf('mobile mqqbrowser')>-1){
				   /*mui.confirm("是否要跳转到商店下载",function(e){
				   	    if (e.index == 1) {  
				   	    	//点击是执行的动作
	                    }
				   });*/
				  $(".maskTishi").css("display","block");
				//微信内置浏览器
				}else if(){
					window.location.href=urls.android;
				// 其他浏览器
				}else{
					window.location.href=urls.android;
				}
			}
		});
		
		$("#ios").on("click",function(){
			if(/android/i.test(navigator.userAgent)){
				//这是Android平台下浏览器
				alert("请点击“安卓下载”按钮");
				return false;
			}
			/*ios的机型和qq内置浏览器*/
		    if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){
				if(/MicroMessenger/i.test(navigator.userAgent)||ua.indexOf('qq') > -1){
				  /* mui.confirm("是否要跳转到商店下载",function(e){
				   	    if (e.index == 1) {  
				   	    	//点击是执行的动作
	                    }
				   });*/
				  $(".maskTishi").css("display","block");
				// 微信内置浏览器
				}else if(ua.match(/MicroMessenger/i) == "micromessenger"){
					window.location.href=urls.android;
					return;
				// 其他浏览器
				}else{
					window.location.href=urls.android;
				}
			}
		});
	</script>
</html>
